var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            cm.closeUI(596);
            cm.onActionBarResult(6, -1);
            if (cm.isQuestFinished(64762) && cm.getQuestStatus(64763) == 0) {
                cm.dispose();
                cm.warp(867147003, 0, true);
                return
            }
            if (cm.getQuestStatus(64762) > 0) {
                cm.npc_ChangeController(9401029, "oid=8646759", -230, 50, 27, -280, -180, 1, true, 0, false);
                cm.npc_SetSpecialAction("oid=8646759", "summon", 0, 0);
                cm.openNewUI(1, "UIAbyssExpeditionManangementButton");
                cm.fakeInit()
            }
            if (cm.isQuestFinished(64772) && !cm.isQuestFinished(64773)) {
                cm.npc_ChangeController(9401052, "oid=13647218", 50, 60, 31, 0, 100, 1, true, 0, false);
                cm.npc_SetSpecialAction("oid=13647218", "summon", 0, 0)
            }
            if (cm.isQuestFinished(64760)) {
                cm.dispose();
                return
            }
            cm.curNodeEventEnd(true);
            cm.eventSKill(0);
            cm.setInGameDirectionMode(true, false, true);
            cm.npc_ChangeController(9401027, "oid=8616231", 1650, 60, 35, 1600, 1700, 1, false, 0, false);
            cm.npc_SetSpecialAction("oid=8616231", "summon", 0, 0);
            cm.inGameDirectionEvent_AskAnswerTime(600);
            cm.curNodeEventEnd(true)
        } else {
            if (status === a++) {
                cm.sendNewEffects(13, [5000, 1300, 0, 0, 0])
            } else {
                if (status === a++) {
                    cm.inGameDirectionEvent_AskAnswerTime(5000)
                } else {
                    if (status === a++) {
                        cm.sendNormalTalk_Bottom("我在这里，快来。", 37, 9401023, false, true)
                    } else {
                        if (status === a++) {
                            cm.Npc_Fadeout("oid=8616231", 0, 1200);
                            cm.inGameDirectionEvent_AskAnswerTime(1200)
                        } else {
                            if (status === a++) {
                                cm.npc_LeaveField("oid=8616231");
                                cm.npc_LeaveField("oid=8616231");
                                cm.sendNewEffects(19, [0])
                            } else {
                                if (status === a++) {
                                    cm.eventSKill(0);
                                    cm.setInGameDirectionMode(false, true, false);
                                    cm.OnStartNavigation(867147001, 0, "in00", 0);
                                    cm.dispose()
                                }
                            }
                        }
                    }
                }
            }
        }
    }
};